﻿// ===============================================================================
// XCI.Parent 西安交通信息WinForm开发框架 2019 版权所有
// ===============================================================================

using System;
using System.Diagnostics;
using System.Windows.Forms;
using XCI.Windows.Forms;
using XCI.Windows.Helper;

namespace XCI.Sys.Forms
{
    public partial class FrmAbout : FrmBase
    {
        public FrmAbout()
        {
            InitializeComponent();
            SetStyle(ControlStyles.DoubleBuffer
                     | ControlStyles.AllPaintingInWmPaint
                     | ControlStyles.UserPaint, true);

            labTitle.Parent
                = picLogo.Parent
                    = labSQ.Parent
                        = labLicense.Parent
                            = this;
            WinHelper.RegEscCloseForm(this);
        }

        private void AboutForm_Load(object sender, EventArgs e)
        {
            btnOK.Location = new System.Drawing.Point(-100, -100);
            this.Text = "关于 " + SysRuntime.Setting.Title;
            this.labTitle.Text = SysRuntime.Setting.Title;
            this.labVersion.Text = SysRuntime.Setting.Version;
            this.labServicePhone.Text = SysRuntime.Setting.Telephone;
            this.linkWebSite.Text = SysRuntime.Setting.WebSite;
            this.labLicense.Text = SysRuntime.Setting.Copyright;
            //this.labCopyright.Text = SysRuntime.SysSetting.Copyright;
            //this.labDevelopPerson.Text = globalSetting.Develop;

            WinHelper.CenterControl(this, labTitle, this, true, false);
        }

        private void SystemAboutForm_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void linkCompony_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                Process.Start(linkWebSite.Text);
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}